﻿namespace K9Nano.AspNetCore.Api
{
    public class ApiResponse
    {
        public int Code { get; set; }

        public string Message { get; set; }

        public string Error { get; set; }

        public object Result { get; set; }

        public ApiResponse()
        {
        }

        public ApiResponse(int code, string message, string error)
        {
            Code = code;
            Message = message;
            Error = error;
        }

        public static ApiResponse FromDto(object dto)
        {
            return new ApiResponse
            {
                Result = dto
            };
        }
    }
}